# coding=utf-8
__author__ = 'st316'
'''
今天下午阿里电面的题目，给定一个字符串，输出其所有连续子串，
如：给定字符串为abcd，则要输出的其全部连续子串为：a，b，c，d，ab，bc，cd，abc，bcd，abcd。
'''


class Solution:
    # @param points, a list of Points
    # @return an integer
    def findSubString(self, s):
        start = 0  # 开始点，一般就是0
        length = 1  # 子串长度
        while length <= len(s):
            print s[start:start + length]
            start += 1
            if start + length > len(s):
                start = 0
                length += 1


if __name__ == '__main__':
    #s = Solution()
    #s.findSubString("ABCE")
    l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]
    import time

    cur = time.clock()
    for x in xrange(100000000):
        a = l[1:18]
    end = time.clock()
    print cur - end

    s = '12345678900000000000000000000000000000'
    cur = time.clock()
    for x in xrange(100000000):
        a = s[1:18]
    end = time.clock()
    print cur - end
